package br.gov.ana.pulsodagua.util;

import java.util.Comparator;

import br.gov.ana.pulsodagua.entidades.Chuva;

public class MyObjComparator implements Comparator {
    
    public int compare(Object o1, Object o2) {
        Chuva ob1 = (Chuva)o1;
        Chuva ob2 = (Chuva)o2;
        if( ob1.getMaxima() == ob2.getMaxima() ) {
            return 0;    
        } else if( ob1.getMaxima() < ob2.getMaxima() ) {
            return 1;
        } else if( ob1.getMaxima() > ob2.getMaxima() ) {
            return -1;
        }
        return 0;
    }    
}